#!/usr/bin/env python
# -*- coding: utf-8 -*-

from __future__ import print_function
import time
from dronekit import connect, VehicleMode, LocationGlobalRelative
from pymavlink import mavutil
import re
import serial 

import RPi.GPIO as GPIO

GPIO.setmode(GPIO.BOARD) #引脚编码方式
GPIO.setwarnings(False) #忽略GPIO警告

FORWARD_CLEAR = 12
GPIO.setup(FORWARD_CLEAR, GPIO.IN)

while True:
    if GPIO.input(FORWARD_CLEAR):
        print('FORWARD_CLEAR was HIGH')
    else:
        print('FORWARD_CLEAR was LOW')

GPIO.cleanup()